﻿Public Class FormProductEditor

    Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click

        'validate other textbox...........

        If Me.txtPrice.Text = "" Then
            MsgBox("Please input product price!")
            Me.txtPrice.Focus()
            Return
        End If


        If Validator.IsDecimal(txtPrice.Text) = False Then
            MsgBox("Price must be a decimal value!")
            Me.txtPrice.Focus()
            Me.txtPrice.SelectAll()
            Exit Sub
        End If

        If Convert.ToDecimal(Me.txtPrice.Text) <= 0 Then
            MsgBox("Price must be positive")
            Me.txtPrice.Focus()
            Me.txtPrice.SelectAll()
            Exit Sub
        End If


    End Sub

 

End Class